#include "ErrorUtility.h"

ErrorUtility::ErrorUtility()
	:bLogToFile(false)
{
}
ErrorUtility::~ErrorUtility()
{
}
ErrorUtility::ErrorUtility(const ErrorUtility& source)
{
}
ErrorUtility& ErrorUtility::operator=(const ErrorUtility& rhs)
{
	return *this;
}

void ErrorUtility::Log(const string& message,const string& errorLevel)
{
	printf("%s: %s\n",errorLevel.c_str(),message.c_str());
	LogFile file;
	file.Log(errorLevel+" - "+message);
}

ErrorUtility& ErrorUtility::Instance()
{
	static ErrorUtility singleton;
	return singleton;
}
void ErrorUtility::LogToFile(bool flag)
{
	bLogToFile=flag;
}
void ErrorUtility::Info(const string& message)
{
	Log(message,"Info");
}
void ErrorUtility::Warning(const string& message)
{
	Log(message,"Warning");
}
void ErrorUtility::Error(const string& message)
{
	Log(message,"Error");
}